<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>
	<script type="text/javascript">
		//substring(开始的下标，结束的下标)  左闭右开
		let str = "孙悟空摘香蕉"
		console.log(str.substring(1, 3))

		//substr(开始的下标，截取的长度)
		console.log(str.substr(0, 3))//孙悟空

		//slice(开始的下标，结束的下标)  左闭右开
		console.log(str.slice(0, 3))
	</script>
</body>
</html>